package ar.edu.utn.frgp.Banco.actions;

import ar.edu.utn.frgp.Banco.model.Cliente;
import ar.edu.utn.frgp.Banco.service.IRecursoService;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;

public class ClienteListarAction extends ActionSupport implements ModelDriven<Cliente> {
	
	@Autowired
	private IRecursoService recursoService;
	
	private List<Cliente> clientes = new ArrayList<Cliente>();

	private static final long serialVersionUID = 1L;

	public List<Cliente> getClientes() {
		return clientes;
	}

	public void setClientes(List<Cliente> clientes) {
		this.clientes = clientes;
	}

	@Override
	public String execute() throws Exception {
		clientes = recursoService.getClientes();
		return SUCCESS;
	}

	public Cliente getModel() {
		return null;
	}
	//public IRecursoService getService() {
	//	return service;
	//}

	//public void setService(IRecursoService service) {
	//	this.service = service;
	//}
}
